package com.youlai.boot.system.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.youlai.boot.system.model.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.time.LocalDateTime;
import java.util.List;

@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
public class TaskTableDTO {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "序号")
    private Long id;
    private List<User> userList;


    @Schema(description = "任务名称")
    @Size(max=255, message="任务名称长度不能超过255个字符")
    private String taskname;

    @Schema(description = "任务负责人人")
    private String taskcharge;

    @Schema(description = "任务创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime addtime;

    @Schema(description = "任务优先级")
    @Size(max=255, message="任务优先级长度不能超过255个字符")
    private String taskpriority;

    @Schema(description = "任务预计开始时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime predictstart;

    @Schema(description = "任务预计结束时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime predictcompletion;

    @Schema(description = "任务实际开始时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime commencement;

    @Schema(description = "任务实际结束时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime closure;

    @Schema(description = "剩余时间")
    private Double shengyu;

    @Schema(description = "耗时")
    private Double elapsed;

    @Schema(description = "任务状态（1已完成/0未完成）")
    private Integer state;
    @Schema(description = "任务归档（1已归档/0未归档）")
    private Integer archive;

    private  String username;
}
